package com.zxj.schoolxianyu.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zxj.schoolxianyu.dao.collectDao;
import com.zxj.schoolxianyu.entity.collect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class getCollectStateService {
    @Autowired(required = false)
    private collectDao collectDao;

    public String getState(String username, Integer goodsid) {
        EntityWrapper<collect> c = new EntityWrapper<>();
        c.eq("username", username);
        c.eq("goodsid", goodsid);
        List<collect> cs = collectDao.selectList(c);
        if (cs.isEmpty()) return "false";
        else return "true";
    }
}
